package com.jbm.jbmsupplier.utlis;

import android.os.Handler;
import android.os.Message;

/**
 * Created by 家帮忙 on 2017/4/10.
 */

public class UtlisHandler {
    public static UtlisHandler utilshandler;
    private Handlerclass handlercla;
    public  UtlisHandler(){

    };
    public static UtlisHandler getinstance(){
        if (utilshandler==null){
            synchronized (UtlisHandler.class){
                if (utilshandler==null){
                    utilshandler=new UtlisHandler();
                }
            }
        }
       return utilshandler;

    }
    public Handler getHandlers(){
        handlercla=new Handlerclass();
        final Handler handler=new Handler(){
            @Override
            public void handleMessage(Message msg) {
                int whats = msg.what;
                 Object ob=msg.obj;
                handlercla.setWhat(whats);
                handlercla.setObj(ob);
                setDateinters. getHandlerdate(handlercla);
                super.handleMessage(msg);
            }
        };

        return handler;
    }
    setDateinter setDateinters;
    public void gethandler(setDateinter setDateinters){
       this.setDateinters= setDateinters;
    }

      public interface  setDateinter{
       void getHandlerdate(Handlerclass handlercla);

    }
}
